<?php
/**
 * Pipahr
 *
 * @author Randy Zhao
 * @copyright 2013 pipahr.com
 */
defined('_JEXEC') or die;

// disable core styles to avoid bs conflict
OC_Util::$core_styles = array();

if (isDevMode()) {
   OCP\Util::addStyle('interview', 'interview');
   OCP\Util::addScript('interview', 'result');
} else {
   OCP\Util::addStyle('static', 'interview');
   OCP\Util::addScript('static', 'apps/interview.result.min');
}

$lang = PFactory::getLanguage();
$lang->load("com_jobs", JPATH_SITE, "zh-CN");

$todo_list_text = $_['todo_list_text'];
$company_url = PInterviewHelper::getCompanyUrl($_['basicInfo']->sub_domain,0);
$company_url = $company_url ? $company_url."?utp=nocp" : '';
?>
<script type="text/javascript" src="<?php print_unescaped(OC_Helper::linkTo('interview/js', 'interview.php'));?>"></script>

<div class="row-fluid">
   <div class="span12">
      <div class="company_info_box clearfix">
         <div class="company_showimg pull-left">
            <?php if (!empty($company_url)) : ?>
            <a href="<?=$company_url?>" target="_blank">
               <img src="<?php echo PCompanyHelper::showCompanyAvatar($_['basicInfo']->avatar, $_['basicInfo']->avatarapproved);?>" class="cpy_logo_mid"/>
            </a>
            <?php else : ?>
            <img src="<?php echo PCompanyHelper::showCompanyAvatar($_['basicInfo']->avatar, $_['basicInfo']->avatarapproved);?>" class="cpy_logo_mid"/>
            <?php endif;?>
         </div>
         <div class="company_showinfo">
            <h4 class="yahei">
               <?php if (!empty($company_url)) : ?>
               <a href="<?=$company_url?>" target="_blank"><?=$_['basicInfo']->comp_name?></a>
               <?php else : ?>
               <?=$_['basicInfo']->comp_name?>
               <?php endif;?>
               <i class="<?php echo $_['basicInfo']->validated == EMPLOYER_VALIDATED ? "is_approve" : "not_approve";?>"></i>
            </h4>
            <ul class="company_listinfo medium">
               <li>行业：<?php echo $_['basicInfo']->industry ? JText::_($_['basicInfo']->industry) : '未填写';?></li>
               <li>性质：<?php echo $_['basicInfo']->comp_type ? JText::_($_['basicInfo']->comp_type) : '未填写';?></li>
               <li>规模：<?php echo $_['basicInfo']->size_type ? JText::_($_['basicInfo']->size_type) : '未填写';?></li>
               <li>所在地区：<?php echo !empty($_['basicInfo']->cstate) || !empty($_['basicInfo']->ccity) ? $_['basicInfo']->cstate.$_['basicInfo']->ccity : "未填写";?></li>
            </ul>
         </div>
      </div>
   </div>
</div>

<div class="container">
   <div class="row-fluid">
      <div class="span12 blackbottom">
         <div class="company_position_show clearfix">
            招聘职位：<?php echo $_['basicInfo']->job_title ? $_['basicInfo']->job_title : '未填写';?> |
            工作城市：<?php echo ($_['basicInfo']->state || $_['basicInfo']->city) ? ($_['basicInfo']->state == $_['basicInfo']->city ? $_['basicInfo']->state : $_['basicInfo']->state.' '.$_['basicInfo']->city) : '未填写'; ?> |
            薪水：<?php echo $_['basicInfo']->salary_type ? $_['basicInfo']->salary_type : '未填写';?> |
            经验：<?php echo $_['basicInfo']->exp_name ? JText::_($_['basicInfo']->exp_name) : '未填写';?> |
            招聘人数：<?php echo $_['basicInfo']->num_needed ? $_['basicInfo']->num_needed : '未填写';?>
         </div>
      </div>
   </div>
</div>

<div class="container">
   <div class="row-fluid">
      <div class="span12">
         <div class="company_qes_fixed large clearfix"><?=$_['basicInfo']->job_title;?>职位线上竞聘</div>
      </div>
   </div>
</div>

<div class="row-fluid hr_oneconn_margin">
   <div class="span12 oneconn_box">
      <div class="lgrg_form">
         <div class="hr_inputinfo">
            <?php if(OC_User::isLoggedIn() || $_['has_verified_token']):?>
            <div class="hr_teststep hr_teststep_nomargin">
               <table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                     <td width="" class="medium test_ok"><span class="teststep_1"><i></i>核对身份</span></td>
                     <td width="22" class="arrow_blue_blue"></td>
                     <td width="" class="medium test_ok"><span class="teststep_2"><i></i>完善信息</span></td>
                     <?php if ($_['isPaperSet'] && $_['isInviteToken']) :?>
                     <td width="22" class="arrow_blue_blue"></td>
                     <td width="" class="medium test_ok"><span class="teststep_3"><i></i>线上笔试</span></td>
                     <?php endif;?>
                     <td width="22" class="arrow_blue_blue"></td>
                     <td width="" class="medium test_ok"><span class="teststep_4"><i></i>完成&nbsp;&nbsp;&nbsp;</span></td>
                  </tr>
               </table>
            </div>
            <?php endif; ?>
            <div class="hr_testerinfo_input">
               <div class="test_sub_des">
                  <?php if(OC_User::isLoggedIn() && PFactory::isJobseekerUser()):?>
                  <div class="test_sub_success"><img src="/images/3/submit_success.png"/></div>
                  <div class="test_notice">
                     <b class="resulttexttip_b" style="font-size:16px; line-height:27px;">人事主管会尽快评估，如符合职位要求，将与您进一步联系。<br/>如您未收到通知，说明暂时没有相符的职位空缺，您的简历将进入公司人才库，一旦有相应机会，将优先考虑。</b>
                     <?php if (!empty($todo_list_text) && $_['isInviteToken']) :?>
                     请进入个人中心，以便跟踪职位应聘进度，完成该职位的<?=$todo_list_text?>，并及时获知反馈。
                     <?php else: ?>
                     请进入个人中心，以便跟踪职位应聘进度，并及时获知反馈。
                     <?php endif; ?>
                  </div>
                  <div class="test_otherlink">
                     <div class="ready_btn ready_btn_top">
                        <a href="<?=OC_Helper::linkToRoute("jobseeker_home")?>" class="ppp_bluebtn ready_btn_width">进入个人中心</a>
                     </div>
                  </div>
                  <?php elseif(!empty($_['isRegistered'])):?>
                  <div class="test_notice">
                     <?php if (!empty($todo_list_text) && $_['isInviteToken']) :?>
                     请登录，以便跟踪职位应聘进度，完成该职位的<?=$todo_list_text?>，并及时获知反馈。
                     <?php else: ?>
                     请登录，以便跟踪职位应聘进度，并及时获知反馈。
                     <?php endif; ?>
                  </div>
                  <div class="hr_testinfo_form">
                     <form action="<?php echo OC_Helper::linkToRoute("jobseeker_postlogin");?>" method="post" name="jobseekerloginform" id="jobseekerloginform">
                        <?php if(empty($_['basicInfo']->jobseeker_name)): ?>
                        <div class="hr_form_group clearfix">
                           <label class="hr_name_label key" for="name">姓名:</label>
                           <div class="hr_controls">
                              <span style="display:inline-block; padding-top:5px;">
                              <?php echo $_['basicInfo']->jobseeker_name; ?>
                              </span>
                           </div>
                        </div>
                        <?php endif; ?>

                        <div class="hr_form_group clearfix">
                           <label class="hr_name_label key" for="email">登录邮箱:</label>
                           <div class="hr_controls">
                              <span style="display:inline-block; padding-top:5px;">
                                 <?php echo starEmail($_['basicInfo']->jobseeker_email);?>
                              </span>
                              <input type="hidden" name="username" value="<?=$_['basicInfo']->jobseeker_email?>"/>
                           </div>
                        </div>

                        <div class="hr_form_group clearfix">
                           <label class="hr_name_label key" for="password"><span class="required">*</span>密码</label>
                           <div class="hr_controls">
                              <input type="password" name="password" id="password" class="input-large required"/>
                              <a href="<?php echo OC_Helper::linkToRoute("jobseeker_lostpassword");?>" class="medium marginleft">忘记密码</a>
                           </div>
                        </div>

                        <?php if(!isDevMode()): ?>
                        <?php 
                        $app = PFactory::getApplication();
                        $needcaptcha = $app->getUserState("login_failed_captcha", false);
                        echo '
                           <div class="hr_form_group" id="logincaptcha" style="display:' . ($needcaptcha ? "" : "none")  . '">
                              <label class="hr_name_label key"><span class="required">*</span>安全码</label>
                              <div class="hr_controls">
                                 <input type="text" class="input-medium" placeholder="请填写下图中字符" id="captcha_code" name="captcha_code" maxlength="6" autocomplete="off" ' . (!$needcaptcha ? 'disabled="disabled"':'') . '/>
                                 <span class="help-inline medium notpasschecked" for="captcha_code"></span>
                                 <div style="margin-top:5px;">
                                    <img id="captcha" style="width:164px;display:none;" class="captchaimg" src="/images/blank.png" alt="请输入图中数字和字符"/><span class="help-inline medium"><a href="#" id="captcha_reload" title="如果安全码不清楚，点击一下更新">换一换</a></span>
                                 </div>
                               </div>
                            </div>
                           ';
                        ?>
                        <?php endif; ?>

                        <div class="hr_form_group clearfix">
                           <div class="hr_controls">
                              <input type="submit" class="ppp_bluebtn pull-left submit_btn" value="提 交" disabled="disabled"/>
                           </div>
                        </div>
                        <div class="hr_form_group clearfix">
                           <label class="hr_name_label key"></label>
                           <div class="hr_controls">
                              <div class="error server" style="margin-top: 10px; margin-left: 0px;"></div>
                           </div>
                        </div>

                        <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
                     </form>
                  </div>
                  <?php elseif($_['has_verified_token']): ?>
                  <div class="test_sub_success"><img src="/images/3/submit_success.png"/></div>
                  <div class="test_notice">
                     <b class="resulttexttip_b yahei" style="font-size:16px; line-height:27px;">人事主管会尽快评估，如符合职位要求，将与您进一步联系。<br/>如您未收到通知，说明暂时没有相符的职位空缺，您的简历将进入公司人才库，一旦有相应机会，将优先考虑。</b>
                     <?php if (!empty($todo_list_text) && $_['isInviteToken']) :?>
                     <em>请您设置密码，以便登录pipahr.com跟踪职位应聘进度，完成该职位的<?=$todo_list_text?>，并及时获知反馈。</em>
                     <?php else: ?>
                     <em>请您设置密码，以便登录pipahr.com跟踪职位应聘进度，及时获知反馈。</em>
                     <?php endif; ?>
                  </div>
                  <div class="hr_testinfo_form">
                     <form action="<?php echo OC_Helper::linkToRoute("jobseeker_saveregemp");?>" method="post" name="jobseekerregform" id="jobseekerregform">
                        <?php if(empty($_['basicInfo']->jobseeker_name)): ?>
                        <div class="hr_form_group clearfix">
                           <label class="hr_name_label key" for="name" style="width:280px;">姓名:</label>
                           <div class="hr_controls" style="margin-left:285px;">
                              <span style="display:inline-block; padding-top:5px;">
                                 <input type="text" maxlength="100" class="input-large required" name="name" id="name" minlenght="2"/>
                              </span>
                           </div>
                        </div>
                        <?php endif; ?>

                        <div class="hr_form_group clearfix">
                           <label class="hr_name_label key" for="email" style="width:280px;">登录邮箱:</label>
                           <div class="hr_controls" style="margin-left:285px;">
                              <span style="display:inline-block; padding-top:5px;">
                                 <?php echo starEmail($_['basicInfo']->jobseeker_email);?>
                              </span>
                           </div>
                        </div>

                        <div class="hr_form_group clearfix">
                           <label class="hr_name_label key" for="password" style="width:280px;"><span class="required">*</span>密码</label>
                           <div class="hr_controls" style="margin-left:285px;">
                              <input type="password" maxlength="15" minlength="6" name="password" id="password" title="密码长度6～15位，字母区分大小写" class="input-large required"/>
                              <span class="medium label label-warning soft" style="white-space:normal;display:none;">建议使用包含数字、字母、下划线组合的安全密码，否则有可能会造成信息泄漏的危险。</span>
                           </div>
                        </div>
                        <div class="hr_form_group clearfix">
                           <label class="hr_name_label key" for="password2" style="width:280px;"><span class="required">*</span>确认密码</label>
                           <div class="hr_controls" style="margin-left:285px;">
                              <input type="password" maxlength="15" minlength="6" name="password2" id="password2"  class="input-large required" />
                           </div>
                        </div>

                        <div class="hr_form_group clearfix">
                           <div class="hr_controls" style="margin-left:285px;">
                              <input type="submit" class="ppp_bluebtn pull-left submit_btn" value="提 交" disabled="disabled"/>
                              <label class="checkbox medium pull-left" style="width:auto; padding-top:5px; margin-left:10px;">
                                 <input type="checkbox" name='acceptedterms' checked="checked" value=""/>已阅读并同意<a target="_blank" href="/helps/doc/product/termofservice.html" class="medium">《枇杷派服务条款》</a>
                              </label>
                           </div>
                        </div>

                        <div class="hr_form_group clearfix">
                           <label class="hr_name_label key" style="width:280px;"></label>
                           <div class="hr_controls" style="margin-left:285px;">
                              <div id="regmsg" class="error" style="margin-top: 10px; margin-left: 0px;"></div>
                           </div>
                        </div>

                        <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
                     </form>
                  </div>
                  <?php endif; ?>

               </div>
            </div>
         </div>
      </div>
   </div>
</div>

